﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using GrayParrot.Web.Formly;

namespace FimetContoDeposito.BLL.Metadata
{
    public class DocumentoMetadata
    {
        [FieldGroup(GroupName = "primo", Row = 1, Index = 1, NumberOfColumns = 3)]
        [FormFieldAttribute(Type = FormFieldTypes.Input)]
        [TextTemplateOptionsAttribute(Label = "Numero Doc.",
            Description = "Lunghezza max 50 caratteri",
            Placeholder = "Indicare il numero documento",
            Required = true,
            MinLength = 0,
            MaxLength = 50)]
        public string NumeroDocumento { get; set; }

        [FieldGroup(GroupName = "primo", Row = 1, Index = 2, NumberOfColumns = 3)]
        [FormFieldAttribute(Type = FormFieldTypes.Select)]
        [SelectTemplateOptions(Label = "Tipo Doc.",
                               Placeholder = "Indicare il tipo di documento...",
                               Required = true,
                               Callback = "/api/Common/LoadTipoDocumento", ForceLoad = true)]
        public Guid TipoDocumento { get; set; }

        [FieldGroup(GroupName = "primo", Row = 1, Index = 3, NumberOfColumns = 3)]
        [FormFieldAttribute(Type = FormFieldTypes.Datepicker)]
        [DateTemplateOptions(Label = "Data Doc.",
                                 Placeholder = "Indicare la data del documento...",
                                 Required = true)]
        public DateTime DataDocumento { get; set; }

        [FieldGroup(GroupName = "secondo", Row = 2, Index = 1, NumberOfColumns = 6)]
        [FormFieldAttribute(Type = FormFieldTypes.Select)]
        [SelectTemplateOptions(Label = "Cliente",
                               Placeholder = "Indicare il Cliente a cui fa capo il documento...",
                               Required = true,
                               Callback = "/api/Common/LoadCustomers", ForceLoad = true, OnChangeCallback="ResetAll")]
        public Guid Customer { get; set; }


    }
}
